{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\FEVS_2016.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}17 Jun 2021, 23:11:46

{com}. import delimited "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\FEVS\FEVS_2010-2019\fevs_2016_prdf.csv"
{res}{text}(80 vars, 407,789 obs)

{com}. svyset [pweight=postwt]

      {txt}pweight:{col 16}{res}postwt
          {txt}VCE:{col 16}{res}linearized
  {txt}Single unit:{col 16}{res}missing
     {txt}Strata 1:{col 16}<one>
         SU 1:{col 16}<observations>
        FPC 1:{col 16}<zero>
{p2colreset}{...}

{com}. 
. 
. 
. 
. 
. drop if q17=="X"
{txt}(17,784 observations deleted)

{com}. 
. drop if q17==""
{txt}(3,081 observations deleted)

{com}. 
. drop if q37=="X"
{txt}(18,521 observations deleted)

{com}. 
. drop if q37==""
{txt}(8,183 observations deleted)

{com}. 
. drop if q38=="X"
{txt}(16,440 observations deleted)

{com}. 
. drop if q38==""
{txt}(4,208 observations deleted)

{com}. 
. drop if q15=="X"
{txt}(3,201 observations deleted)

{com}. 
. drop if q15==""
{txt}(1,299 observations deleted)

{com}. 
. drop if q22=="X"
{txt}(13,289 observations deleted)

{com}. 
. drop if q22==""
{txt}(2,482 observations deleted)

{com}. 
. drop if q25=="X"
{txt}(7,993 observations deleted)

{com}. 
. drop if q25==""
{txt}(1,917 observations deleted)

{com}. 
. drop if q33=="X"
{txt}(6,696 observations deleted)

{com}. 
. drop if q33==""
{txt}(2,756 observations deleted)

{com}. 
. drop if q48==.
{txt}(2,157 observations deleted)

{com}. 
. drop if q49==.
{txt}(1,242 observations deleted)

{com}. 
. 
. 
. destring q17, replace
{txt}q17: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q37, replace
{txt}q37: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q38, replace
{txt}q38: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q15, replace
{txt}q15: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q22, replace
{txt}q22: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q25, replace
{txt}q25: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q33, replace
{txt}q33: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. 
. 
. svy linearized : sem (JUSTICE -> DISTRIBUTIVE, ) (JUSTICE -> PROCEDURAL, ) (JUSTICE -> INTERPERSONAL, ) (DISTRIBUTIVE -> q22, ) (DISTRIBUTIVE -> q25, ) (DISTRIBUTIVE -> q33, ) (PROCEDURAL -> q15, ) (PROCEDURAL -> q17, ) (PROCEDURAL -> q37, ) (PROCEDURAL -> q38, )(INTERPERSONAL -> q48, ) (INTERPERSONAL -> q49, ), standardized latent(JUSTICE DISTRIBUTIVE PROCEDURAL INTERPERSONAL ) nocapslatent
{txt}(running sem on estimation sample)
{res}
{txt}{col 1}Survey: Structural equation model{col 49}Number of obs{col 67}= {res}   296,540
{txt}{col 1}Number of strata{col 22}= {res}        1{txt}{col 49}Population size{col 67}={res}  1,318,209
{txt}{col 1}Number of PSUs{col 22}= {res}  296,540{txt}{col 49}Design df{col 67}= {res}   296,539

{p 0 7}{space 1}{text:( 1)}{space 1} [q22]DISTRIBUTIVE = 1{p_end}
{p 0 7}{space 1}{text:( 2)}{space 1} [q15]PROCEDURAL = 1{p_end}
{p 0 7}{space 1}{text:( 3)}{space 1} [q48]INTERPERSONAL = 1{p_end}
{p 0 7}{space 1}{text:( 4)}{space 1} [DISTRIBUTIVE]JUSTICE = 1{p_end}
{txt}{hline 20}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 21}{c |}{col 33}  Linearized
{col 1}       Standardized{col 21}{c |}      Coef.{col 33}   Std. Err.{col 45}      t{col 53}   P>|t|{col 61}     [95% Con{col 74}f. Interval]
{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Structural         {col 21}{txt}{c |}
{space 2}{col 3}DISTRIBUTIVE     {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .8504506{col 33}{space 2} .0019466{col 44}{space 1}  436.88{col 53}{space 3}0.000{col 61}{space 4} .8466352{col 74}{space 3}  .854266
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}PROCEDURAL       {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .9844234{col 33}{space 2} .0020536{col 44}{space 1}  479.37{col 53}{space 3}0.000{col 61}{space 4} .9803984{col 74}{space 3} .9884484
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}INTERPERSONAL    {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .7051382{col 33}{space 2} .0022514{col 44}{space 1}  313.20{col 53}{space 3}0.000{col 61}{space 4} .7007256{col 74}{space 3} .7095509
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Measurement        {col 21}{txt}{c |}
{space 2}{col 3}q22              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8454536{col 33}{space 2} .0014231{col 44}{space 1}  594.09{col 53}{space 3}0.000{col 61}{space 4} .8426643{col 74}{space 3} .8482428
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.317515{col 33}{space 2} .0049065{col 44}{space 1}  472.33{col 53}{space 3}0.000{col 61}{space 4} 2.307898{col 74}{space 3} 2.327132
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q25              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8413902{col 33}{space 2} .0014337{col 44}{space 1}  586.85{col 53}{space 3}0.000{col 61}{space 4} .8385801{col 74}{space 3} .8442003
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.432049{col 33}{space 2} .0054686{col 44}{space 1}  444.73{col 53}{space 3}0.000{col 61}{space 4} 2.421331{col 74}{space 3} 2.442768
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q33              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .7223522{col 33}{space 2} .0019071{col 44}{space 1}  378.76{col 53}{space 3}0.000{col 61}{space 4} .7186143{col 74}{space 3} .7260902
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.146244{col 33}{space 2} .0040312{col 44}{space 1}  532.41{col 53}{space 3}0.000{col 61}{space 4} 2.138343{col 74}{space 3} 2.154145
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q15              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .6312869{col 33}{space 2} .0026519{col 44}{space 1}  238.05{col 53}{space 3}0.000{col 61}{space 4} .6260893{col 74}{space 3} .6364845
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.176697{col 33}{space 2} .0093155{col 44}{space 1}  341.01{col 53}{space 3}0.000{col 61}{space 4} 3.158439{col 74}{space 3} 3.194955
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q17              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .7696666{col 33}{space 2} .0019041{col 44}{space 1}  404.22{col 53}{space 3}0.000{col 61}{space 4} .7659347{col 74}{space 3} .7733985
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.860957{col 33}{space 2} .0076864{col 44}{space 1}  372.21{col 53}{space 3}0.000{col 61}{space 4} 2.845892{col 74}{space 3} 2.876023
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q37              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8294688{col 33}{space 2} .0016936{col 44}{space 1}  489.77{col 53}{space 3}0.000{col 61}{space 4} .8261494{col 74}{space 3} .8327881
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.661373{col 33}{space 2} .0066506{col 44}{space 1}  400.17{col 53}{space 3}0.000{col 61}{space 4} 2.648337{col 74}{space 3} 2.674408
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q38              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8154931{col 33}{space 2} .0018236{col 44}{space 1}  447.20{col 53}{space 3}0.000{col 61}{space 4} .8119189{col 74}{space 3} .8190672
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.193447{col 33}{space 2} .0094262{col 44}{space 1}  338.78{col 53}{space 3}0.000{col 61}{space 4} 3.174971{col 74}{space 3} 3.211922
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q48              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9409024{col 33}{space 2} .0012133{col 44}{space 1}  775.52{col 53}{space 3}0.000{col 61}{space 4} .9385245{col 74}{space 3} .9432804
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.653054{col 33}{space 2} .0115667{col 44}{space 1}  315.82{col 53}{space 3}0.000{col 61}{space 4} 3.630384{col 74}{space 3} 3.675725
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q49              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2}  .917142{col 33}{space 2} .0013049{col 44}{space 1}  702.82{col 53}{space 3}0.000{col 61}{space 4} .9145843{col 74}{space 3} .9196996
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.994821{col 33}{space 2} .0138606{col 44}{space 1}  288.21{col 53}{space 3}0.000{col 61}{space 4} 3.967654{col 74}{space 3} 4.021987
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 10}var(e.q22){c |}{col 21}{res}{space 2} .2852083{col 33}{space 2} .0024063{col 61}{space 4} .2805307{col 74}{space 3} .2899638
{txt}{space 10}var(e.q25){c |}{col 21}{res}{space 2} .2920625{col 33}{space 2} .0024127{col 61}{space 4} .2873719{col 74}{space 3} .2968298
{txt}{space 10}var(e.q33){c |}{col 21}{res}{space 2} .4782072{col 33}{space 2} .0027553{col 61}{space 4} .4728374{col 74}{space 3} .4836381
{txt}{space 10}var(e.q15){c |}{col 21}{res}{space 2} .6014769{col 33}{space 2} .0033482{col 61}{space 4} .5949502{col 74}{space 3} .6080752
{txt}{space 10}var(e.q17){c |}{col 21}{res}{space 2} .4076134{col 33}{space 2}  .002931{col 61}{space 4}  .401909{col 74}{space 3} .4133987
{txt}{space 10}var(e.q37){c |}{col 21}{res}{space 2} .3119815{col 33}{space 2} .0028095{col 61}{space 4} .3065232{col 74}{space 3}  .317537
{txt}{space 10}var(e.q38){c |}{col 21}{res}{space 2} .3349711{col 33}{space 2} .0029742{col 61}{space 4} .3291921{col 74}{space 3} .3408514
{txt}{space 10}var(e.q48){c |}{col 21}{res}{space 2} .1147026{col 33}{space 2} .0022831{col 61}{space 4}  .110314{col 74}{space 3} .1192659
{txt}{space 10}var(e.q49){c |}{col 21}{res}{space 2} .1588506{col 33}{space 2} .0023936{col 61}{space 4} .1542278{col 74}{space 3}  .163612
{txt}{space 1}var(e.DISTRIBUTIVE){c |}{col 21}{res}{space 2} .2767338{col 33}{space 2} .0033111{col 61}{space 4} .2703197{col 74}{space 3} .2833001
{txt}{space 3}var(e.PROCEDURAL){c |}{col 21}{res}{space 2} .0309106{col 33}{space 2} .0040432{col 61}{space 4} .0239203{col 74}{space 3} .0399436
{txt}var(e.INTERPERSONAL){c |}{col 21}{res}{space 2} .5027801{col 33}{space 2} .0031751{col 61}{space 4} .4965954{col 74}{space 3} .5090418
{txt}{space 8}var(JUSTICE){c |}{col 21}{res}{space 2}        1{col 33}{space 2}        .{col 61}{space 4}        .{col 74}{space 3}        .
{txt}{hline 20}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. 
. 
. estat gof, stats(all)
{res}
{txt}{hline 21}{c TT}{hline 54}
{lalign 21:Fit statistic}{c |}      Value   Description
{hline 21}{c +}{hline 54}
{lalign 21:Size of residuals}{c |}
{ralign 20:SRMR} {c |} {res}{ralign 10:     0.038}{txt}   Standardized root mean squared residual
{ralign 20:CD} {c |} {res}{ralign 10:     0.972}{txt}   Coefficient of determination
{hline 21}{c BT}{hline 54}
{p 0 2 2 75}Note: model was fit with{txt} svy: prefix; only stats(residuals) valid.{p_end}

{com}. predict justice, latent(JUSTICE)
{res}
{com}. 
. 
. 
. egen average_justice = mean (justice), by (agency)

. 
. 
. 
. egen sub_average_justice = mean (justice), by (plevel1)

. save "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2016FEVS_Justice.dta"
{txt}file C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2016FEVS_Justice.dta saved

{com}. exit, clear
